package entity;

import java.sql.Date;

public class Orders {
    int orderId;

    int ticketId;

    int userId;

    int train_id;

    String totalPrice;

    Date orderTime;

    String Status;

    Ticket ticket;

    Train train;

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public int getTicketId() {
        return ticketId;
    }

    public void setTicketId(int ticketId) {
        this.ticketId = ticketId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(String totalPrice) {
        this.totalPrice = totalPrice;
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    public String getStatus() {
        return Status;
    }

    public void setStatus(String status) {
        Status = status;
    }

    public Ticket getTicket() {
        return ticket;
    }

    public void setTicket(Ticket ticket) {
        this.ticket = ticket;
    }

    public int getTrain_id() {
        return train_id;
    }

    public void setTrain_id(int train_id) {
        this.train_id = train_id;
    }

    public Train getTrain() {
        return train;
    }

    public void setTrain(Train train) {
        this.train = train;
    }

    @Override
    public String toString() {
        return "Orders{" +
                "orderId=" + orderId +
                ", ticketId=" + ticketId +
                ", userId=" + userId +
                ", train_id=" + train_id +
                ", totalPrice='" + totalPrice + '\'' +
                ", orderTime='" + orderTime + '\'' +
                ", Status='" + Status + '\'' +
                ", ticket=" + ticket +
                ", train=" + train +
                '}';
    }

    public String show(){
        return "订单"+"\n"+
                "订单号："+orderId+"\t"+
                "总金额："+totalPrice+"\t"+
                "订单时间："+orderTime+"\t"+
                "订单状态："+Status+"\t"+"\n"+
                "****"+ticket.show()+"\n"+"%%%%"+train.show();
    }
}
